package com.dynamic.model.util.common;

import java.util.List;

import com.dynamic.model.model.po.SysmanResource;
import com.dynamic.model.service.SystemResourceService;
import org.springframework.web.context.ContextLoader;

public class SysmanResourceServiceUtil {
	
	private static SystemResourceService systemResourceService;

	public static SystemResourceService getService() {

		if (systemResourceService == null) {

			synchronized (SysmanResourceServiceUtil.class) {

				if (systemResourceService == null) {

					systemResourceService = ContextLoader
							.getCurrentWebApplicationContext().getBean(
									SystemResourceService.class);

				}
			}
		}

		return systemResourceService;

	}
	
	public static List<SysmanResource>  getAll(){
		return getService().getAll() ;
	}
}
